package de.lns.entities.mobs;
/**
 * 
 * @author Jascha
 *
 */
public class Armor {

	private double explosion;
	private double physical;
	private double fire;
	private double magical;
	private double poison;
	private double implosion;
	private Mob mob;
	/**
	 * 
	 * @param mob The mob this armor belongs to.
	 */
	public Armor(Mob mob) {
		explosion = 0.0;
		physical = 0.0;
		fire = 0.0;
		magical = 0.0;
		poison = 0.0;
		implosion = 0.0;
		this.mob = mob;
	}
	/**
	 * 
	 * @param explosion explosion armor.
	 * @param physical physical armor.
	 * @param fire fire armor.
	 * @param magical magical armor.
	 * @param poison poison armor.
	 * @param implosion implosion armor.
	 * @param mob The mob this armor belong to.
	 */
	public Armor(double explosion, double physical, double fire,
			double magical, double poison, double implosion, Mob mob) {
		this.explosion = explosion;
		this.physical = physical;
		this.fire = fire;
		this.magical = magical;
		this.poison = poison;
		this.implosion = implosion;
		this.mob = mob;
	}
	/**
	 * 
	 * @return explosion armor.
	 */
	public double getExplosion() {
		double flat = mob.getModificationflat(Modification.explosion);
		double relative = mob.getModificationrelative(Modification.explosion);
		return explosion*((100-relative)/100)-flat;
	}
	/**
	 * 
	 * @param explosion  explosion armor.
	 */
	public void setExplosion(double explosion) {
		this.explosion = explosion;
	}
	/**
	 * 
	 * @return physical  armor.
	 */
	public double getPhysical() {
		double flat = mob.getModificationflat(Modification.physical);
		double relative = mob.getModificationrelative(Modification.physical);
		return physical*((100-relative)/100)-flat;
	}
	/**
	 * 
	 * @param physical physical armor.
	 */
	public void setPhysical(double physical) {
		this.physical = physical;
	}
	/**
	 * 
	 * @return fire armor.
	 */
	public double getFire() {
		double flat = mob.getModificationflat(Modification.fire);
		double relative = mob.getModificationrelative(Modification.fire);
		return fire*((100-relative)/100)-flat;
	}
	/**
	 * 
	 * @param fire fire armor.
	 */
	public void setFire(double fire) {
		this.fire = fire;
	}
	/**
	 * 
	 * @return magical armor.
	 */
	public double getMagical() {
		double flat = mob.getModificationflat(Modification.magical);
		double relative = mob.getModificationrelative(Modification.magical);
		return magical*((100-relative)/100)-flat;
	}
	/**
	 * 
	 * @param magical magical armor.
	 */
	public void setMagical(double magical) {
		this.magical = magical;
	}
	/**
	 * 
	 * @return poison armor.
	 */
	public double getPoison() {
		double flat = mob.getModificationflat(Modification.poison);
		double relative = mob.getModificationrelative(Modification.poison);
		return poison*((100-relative)/100)-flat;
	}
	/**
	 * 
	 * @param poison poison armor.
	 */
	public void setPoison(double poison) {
		this.poison = poison;
	}
	/**
	 * 
	 * @return implosion armor.
	 */
	public double getImplosion() {
		double flat = mob.getModificationflat(Modification.implosion);
		double relative = mob.getModificationrelative(Modification.implosion);
		return implosion*((100-relative)/100)-flat;
	}
	/**
	 * 
	 * @param implosion implosion armor.
	 */
	public void setImplosion(double implosion) {
		this.implosion = implosion;
	}

}
